package cn.mw.service.impl;

import cn.mw.domain.Device;
import cn.mw.mapper.DeviceMapper;
import cn.mw.service.IDeviceService;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeviceServiceImpl  implements IDeviceService {
    @Autowired
    private DeviceMapper deviceMapper;
    @Override
    public void add(Device device) {
         deviceMapper.add(device);
    }

    @Override
    public Device getDeviceInfoById(Long id) {
        return deviceMapper.getDeviceInfoById(id);
    }


    /**
     * 楼层内的所有设备
     * @param floorId
     * @return
     */
    @Override
    public List<Device> getDevice(String floorId) {
        return deviceMapper.getDevice(floorId);
    }

}
